import React from 'react'
import subject from '@/assets/images/home/subject.png'
import './examitem.less'
import Button from '@material-ui/core/Button';
import LinearProgress from '@material-ui/core/LinearProgress';
import { useHistory } from 'react-router-dom';
export default function ExamItem(props) {
    // console.log(props);
    // 路由
    const history = useHistory()
    const gotoPractice = () => {
        history.push(`/sq/${props.data.actionCode}`)
    }
    return (
        <div className="exam-list-item">
            <div className="subject">
                <img src={subject} alt="" />
            </div>
            <div className="info">
                <h4>{props.data.info}</h4>
                <span>{props.data.itemCount}/{props.data.itemCount}题</span>
                <LinearProgress variant="determinate" value={props.data.itemCount / props.data.itemCount * 100} />
            </div>
            <Button variant="contained" color="primary" onClick={gotoPractice}>
                练习
            </Button>
        </div>
    )
}
